import  requests

url='http://www.baidu.com/s?'

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0',
    'Cookie': 'BIDUPSID=C2A015CD9A83A71ABE8F565ABAA3EB52; PSTM=1719576859; BAIDUID=C2A015CD9A83A71A95F1AEF1549E8D7E:FG=1; BD_UPN=12314753; BAIDUID_BFESS=C2A015CD9A83A71A95F1AEF1549E8D7E:FG=1; BDORZ=B490B5EBF6F3CD402E515D22BCDA1598; RT="z=1&dm=baidu.com&si=5b19e572-e3ce-44ba-b3ce-e0ddccf84f8a&ss=ly15nmnq&sl=2&tt=2qs&bcn=https%3A%2F%2Ffclog.baidu.com%2Flog%2Fweirwood%3Ftype%3Dperf&ld=chl&ul=9ygg&hd=9ygp"; B64_BOT=1; baikeVisitId=fe923864-25e3-4e1c-8ce6-ed4f39592d7a; COOKIE_SESSION=81942_0_3_5_14_5_1_0_2_3_0_1_22_0_0_0_1719646802_0_1719728735%7C9%230_0_1719728735%7C1; ZFY=RIu0pgI6FIH5vO4WIL6uQpwIvZXySZUs6V0jjzRkHc4:C; H_PS_PSSID=60237_60340_60362_60376_60359; BD_HOME=1; BA_HECTOR=2h2g2h01812g058l81802g8g3f9vq21j844av1u'
}

data  = {
    'wd' :'ip'
}

response = requests.post(url = url,params=data,headers=headers)
content = response.text
with open('cookie.html','w',encoding='utf-8') as f:
    f.write(content)